﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterALSafa.Master" AutoEventWireup="true"
    CodeBehind="District.aspx.cs" Inherits="School.Pages.Bus.District" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="plNew" runat="server" Visible="False">
        <table align="right" dir="rtl" style="width: 100%; float: right">
            <tr>
                <td colspan="4" class="admintitle" align="center">
                    ادخال بيانات
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 95px">
                    المجمع
                </td>
                <td>
                    <asp:DropDownList ID="ddCamp" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                        DataValueField="Id" Width="153px">
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="ddCamp"
                        Display="Dynamic" ErrorMessage="*" Font-Size="Medium" ForeColor="Red" InitialValue="-1"
                        ValidationGroup="re">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 95px">
                    كود المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtcode" runat="server" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtcode"
                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="re">*</asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 95px">
                    إسم المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtName" runat="server" Width="150px"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtName"
                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="re"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td style="width: 95px">
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnSave" runat="server" CssClass="graybutton" OnClick="btnSave_Click"
                        Text="حفظ" ValidationGroup="re" />
                    &nbsp;<asp:Button ID="btnexit" runat="server" CssClass="graybutton" OnClick="btnexit_Click"
                        Text="إلغاء" />
                </td>
            </tr>
            <tr>
                <td style="width: 95px">
                </td>
                <td>
                    <asp:Literal ID="lbltest" runat="server" Visible="False"></asp:Literal>
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Plsearch" runat="server">
        <table align="right" dir="rtl">
            <tr>
                <td colspan="2" class="admintitle" align="center">
                    عرض البيانات
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 92px">
                    المجمع
                </td>
                <td>
                    <asp:DropDownList ID="ddCampse" runat="server" AppendDataBoundItems="True" DataTextField="Name"
                        DataValueField="Id" Width="153px">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 92px">
                    &nbsp; كود المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtcodeSe" runat="server" Width="150px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td nowrap="nowrap" style="width: 92px">
                    &nbsp; إسم المنطقة
                </td>
                <td>
                    <asp:TextBox ID="txtNameSe" runat="server" Width="150px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="width: 92px">
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnsearch" runat="server" CssClass="graybutton" OnClick="btnsearch_Click"
                        Text="بحث" />
                </td>
            </tr>
            <tr>
                <td style="width: 92px">
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                    <asp:Literal ID="lbltestsearch" runat="server" Visible="False"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td style="width: 92px">
                    &nbsp;
                </td>
                <td>
                    <asp:Literal ID="lblRecordNo" runat="server"></asp:Literal>
                </td>
            </tr>
            <tr>
                <td style="width: 92px">
                    &nbsp;
                </td>
                <td>
                    <asp:GridView ID="gvRegion" runat="server" AutoGenerateColumns="False" DataKeyNames="Id"
                        OnRowCancelingEdit="gvRegion_RowCancelingEdit" OnRowDeleting="gvRegion_RowDeleting"
                        OnRowEditing="gvRegion_RowEditing" OnRowUpdating="gvRegion_RowUpdating" Width="752px"
                        AllowPaging="True" OnPageIndexChanging="gvRegion_PageIndexChanging" CssClass="Grid"
                        HeaderStyle-CssClass="GridHeaderFooter" FooterStyle-CssClass="GridHeaderFooter"
                        PagerStyle-CssClass="GridPager" AlternatingRowStyle-CssClass="GridItemAltername"
                        OnRowDataBound="gvRegion_RowDataBound">
                        <AlternatingRowStyle CssClass="GridItemAltername" />
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    م
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="Name" HeaderText="المجمع" ReadOnly="True">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:BoundField>
                            <asp:TemplateField HeaderText="إسم المنطقة" SortExpression="DistName">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtN" runat="server" Text='<%# Bind("DistName") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtN"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="gvr">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("DistName") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="كود المنطقة" SortExpression="Dis_Code">
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtC" runat="server" Text='<%# Bind("Dis_Code") %>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtC"
                                        Display="Dynamic" ErrorMessage="*" ForeColor="Red" ValidationGroup="gvr">*</asp:RequiredFieldValidator>
                                </EditItemTemplate>
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Dis_Code") %>'></asp:Label>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:CommandField CancelText="إلغاء" EditText="تعديل" ShowEditButton="True" UpdateText="تحديث"
                                ValidationGroup="gvr">
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:CommandField>
                            <asp:TemplateField ShowHeader="False">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lkdelete" runat="server" CausesValidation="False" CommandName="Delete"
                                        Text="حذف"></asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            لا توجد بيانات
                        </EmptyDataTemplate>
                        <FooterStyle CssClass="GridHeaderFooter" />
                        <HeaderStyle CssClass="GridHeaderFooter" />
                        <PagerStyle CssClass="GridPager" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td style="width: 92px">
                    &nbsp;
                </td>
                <td>
                    <asp:Button ID="btnadd" runat="server" CssClass="graybutton" OnClick="btnadd_Click"
                        Text="إضافة" />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
